﻿@model InfoSource.Models.Views.AppointmentReminders_EditTemplateViewModel

@{
	ViewBag.Title = "Edit Templates";
    Layout = ViewBag.IsPartial == true ? "" : "~/Views/Shared/_Layout.cshtml";
}



    <div id="appointmentRemindersEditTemplatesPage" class='pageContent' key="@Url.Content("~/appointmentreminders/edittemplates")">
        <h2 class="pageTitle">Edit Email Templates</h2>
        
        <div id="appointmentRemindersEditTemplatesPage-existingTemplatesContainer">
			<span>This editor ONLY works in Firefox, Chrome or IE9+. It is broken in IE8.</span>
            @foreach(InfoSource.Models.objects.EmailTemplate template in Model.EmailTemplates){
                <div class="template-container" templateid="@template.ID">
                    <div class="editor-toolbar"></div>
                    <span class="template-title">Title:</span>
                    <input type="text" class="template-title-input" value="@template.TemplateName" />
                    <textarea class="template-body">@template.TemplateBody</textarea>
                </div>
            }
        </div>

        <br />
        <hr />
        <span class="newTemplateLabel">New:</span>

        <div class="template-container new-template" templateid="">
            <div class="editor-toolbar"></div>
            <span class="template-title">Title:</span>
            <input type="text" class="template-title-input" value="(name)" />
            <textarea class="template-body"></textarea>
        </div>


        <div class="pageLoader"></div>

    </div>




@{
	this.ViewContext.Controller.ViewData["Scripts"] = new List<string>(){
        "/InfoSource/Content/Scripts/Views/AppointmentReminders_EditTemplates.js"
	};

	this.ViewContext.Controller.ViewData["StyleSheets"] = new List<string>(){
        "/InfoSource/Content/Styles/Views/AppointmentReminders_EditTemplates.css"
	};

	this.ViewContext.Controller.ViewData["InlineScripts"] = new List<string>(){
        "InfoSource.EmailTemplates = " + Json.Encode(Model.EmailTemplates) + ";"
	};
}